#include "bo3d.h"

class bFrameListener : public Ogre::FrameListener
{
public:
	void (*__frameStarted) ();
	void (*__frameEnded) ();

	bool frameStarted(const Ogre::FrameEvent &evt)
	{
		this->__frameStarted();
		return true;
	}

	bool frameRenderingQueued(const FrameEvent  &evt)
	{
		return true;
	}

	bool frameEnded(const Ogre::FrameEvent &evt)
	{
		this->__frameEnded();
		return true;
	}
};

BBDECL void __stdcall o_defineFrameStarted(void (*fs)(), bFrameListener* listener)
{
	listener->__frameStarted = fs;
}


BBDECL void __stdcall o_defineFrameEnded(void (*fs)(), bFrameListener* listener)
{
	listener->__frameEnded = fs;
}

BBDECL Ogre::FrameListener* __stdcall o_createFrameListener()
{
	return new bFrameListener;
}